package com.lyf.design.learn.designmodel.singleton;

/**
 * @AUTHOR LYF
 * @DATE 2022/6/1
 * @VERSION 1.0
 * @DESC
 * 饿汉式+细粒度加锁
 */
public class Main5 {
    private static  Main5 INSTANCE;//new Main4();
    private Main5(){}
    static Main5 getInstance(){

            synchronized(Main5.class){
                if(INSTANCE==null)
                     INSTANCE = new Main5();
            }

        return INSTANCE;
    }
    void method(){}
}
